four = ['liuyifan', 'zhu泽昱', 'caoyizhen']
for name in four:
    print(name)

# 从0加到10.这需要把数据写出来
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sum = 0
for num in x:
    sum += num
print(sum)

# 从0加到10000，用range（）来生成一个列表
sum = 0
for num in range(10000):
    sum += num
print(sum)

# 用while
num = 0
sum = 0
while num < 100:
    num += 1
    sum += num
print(sum)

L = ['bart', "Lisa", 'Adam']
for name in L:
    print("hello %s" % name)
    print("hello", name)  # 两种方式都行

# break
# 打印1-100
n = 0
while n < 100:
    n = n + 1;
    if n == 99:
        break
    if n == 50:
        print("the number is %d" % n)
        continue
    print(n)
